#include "dataConfig.h"
#include <iostream>

DataConfig* DataConfig::_dataConfig = new DataConfig();

DataConfig::DataConfig()
{
	_lua = lua_open();
	luaopen_base(_lua);
	lua_tinker::dofile(_lua, OSGIS_CONFIG_LUA_NAME);
}

DataConfig::~DataConfig()
{
	lua_close(_lua);
}

char* DataConfig::getStringProperty( const char* key ) const
{
	return lua_tinker::get<char*>(_lua, key);
}

DataConfig* DataConfig::getInstance()
{
	return _dataConfig;
}

int DataConfig::getIntProperty( const char* key )
{
	return lua_tinker::get<int>(_lua, key);
}
